package agents;

import env.Action;
import env.Enviroment;
import env.Orientation;
import full_search.FullSearch;
import full_search.FullState;
import java.awt.Color;
import javax.swing.Icon;
import javax.swing.ImageIcon;

/**
 *
 * @author user
 */
public class FullAgent extends Agent{
    static Icon iconNorth = new ImageIcon("images/ShipNorth.gif");
    static Icon iconSouth = new ImageIcon("images/ShipSouth.GIF");
    static Icon iconEast = new ImageIcon("images/ShipEast.GIF");
    static Icon iconWest = new ImageIcon("images/ShipWest.GIF");
    
    private FullSearch search;
    //private FullState state;
    
    public FullAgent(String name, int row, int col, Orientation orientation, Color color, FullSearch search) {
        super(name, row, col, orientation, color);
        //state=new FullState(row, col, orientation, Enviroment.env.flags);
        this.search=search;
        search.setAgent(this);
    }
    
    @Override
    public Action getMove() {
        return search.nextAction();
    }

   
    
    
    
//
//    @Override
//    public int getCol() {
//        return state.getCol();
//    }
//
//    @Override
//    public Orientation getOrientation() {
//        return state.getOrientation();
//    }
//
//    @Override
//    public int getRow() {
//        return state.getRow();
//    }

//    @Override
//    public void updatePosition(Action move) {
//        super.updatePosition(move);
//        state.update(move);
//    }

//    @Override
//    public int[] getForward() {
//        FullState fwd=state.clone(Action.fwd);
//        int newCell[] = {fwd.getRow(), fwd.getCol()};
//        return newCell;
//    }
    
    

    
    @Override
    public Icon getIcon() {
        switch (this.getOrientation()) {
            case North:
                return iconNorth;
            case East:
                return iconEast;
            case West:
                return iconWest;
            case South:
                return iconSouth;
        }
        return null;
    }

//    public FullState getState() {
//        return state;
//    }

}